import Vue from "vue";
import VueRouter from "vue-router";

// 引入组件
import index from "../pages/index.vue";
import login from "../pages/admin/login.vue";
import register from "../pages/admin/register.vue";
import success from "../pages/admin/success.vue";
import list from "../pages/list.vue";
import details from "../pages/details.vue";

// 要告诉 vue 使用 vueRouter
Vue.use(VueRouter);

const routes = [{
    path: "/",
    component: index
  },
  {
    path: "/index",
    component: index
  },
  {
    path: "/login",
    component: login
  },
  {
    path: "/register",
    component: register
  },
  {
    path: "/success",
    component: success
  },
  {
    path: "/list",
    component: list
  },
  {
    path: "/details",
    component: details
  }
]

var router = new VueRouter({
  // mode: 'history',
  routes
})

export default router;